home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / gcc / gcc270-b.lha / gnu / etc / profile < prev    next >
Text File  |  1994-07-25  |  6KB  |  242 lines

  1. :
  2. # NAME:
  3. #    profile - global initialization for sh,ksh
  4. #
  5. # DESCRIPTION:
  6. #    This file is processed during login by /bin/sh
  7. #    and /bin/ksh.  It is used to setup the default user
  8. #    environment.  It is processed with root privs.
  9. #
  10. # SEE ALSO:
  11. #    $HOME/.profile
  12. #    /etc/ksh.kshrc
  13. #
  14. # RCSid:
  15. #    $Id: profile,v 1.3 1992/05/03 08:28:27 sjg Exp $
  16. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  17. #
  18. #    This file is provided in the hope that it will
  19. #    be of use.  There is absolutely NO WARRANTY.
  20. #    Permission to copy, redistribute or otherwise
  21. #    use this file is hereby granted provided that 
  22. #    the above copyright notice and this notice are
  23. #    left intact. 
  24.  
  25. case "$_INIT_" in
  26. *env*) ;;
  27. *)    # do these once
  28.     _INIT_="$_INIT_"env
  29.     export _INIT_
  30.     # sys_config.sh should set ARCH,OS,C,N,HOSTNAME,uname
  31.     # we use these in lots of scripts...
  32.     [ -f /etc/sys_config.sh ] && . /etc/sys_config.sh
  33.  
  34.     # pick one of the following for the default umask
  35.     # umask 002    # relaxed    -rwxrwxr-x
  36.     umask 022    # cautious    -rwxr-xr-x
  37.     # umask 027    # uptight    -rwxr-x---
  38.     # umask 077    # paranoid    -rwx------
  39.     # you can override the default umask
  40.     # for specific groups later...
  41.  
  42.     if [ -d /local ]; then
  43.         LOCAL=/local
  44.     else
  45.         LOCAL=/usr/local
  46.     fi
  47.  
  48.     # set system specific things,
  49.     # eg. set PATH,MANPATH 
  50.     # override default ulimit if desired.
  51.     # defult ulmit is unlimited on SunOS
  52.     # and 4Mb for most System V
  53.     case $OS in
  54.     AmigaDOS)
  55.         PATH=/c:/sys/rexxc:/gcc:/usr/bin:$PATH:.
  56.         MANPATH=/usr/share/man
  57.         LOGNAME=root
  58.         USER=root
  59.         defterm=amiga    
  60.         ;;
  61.     SunOS)
  62.         # On sun's /bin -> /usr/bin so leave it out!
  63.         PATH=.:/usr/bin:/usr/ucb:/usr/5bin
  64.         MANPATH=/usr/man
  65.         defterm=vt220
  66.         ;;
  67.     SCO-UNIX)
  68.         PATH=.:/bin:/usr/bin:/usr/lbin:/usr/dbin:/usr/ldbin
  69.         MANPATH=/usr/man
  70.         defterm=ansi
  71.         ;;
  72.     B.O.S.)
  73.         PATH=.:/bin:/usr/bin
  74.         if [ -d /usr/ucb ]; then
  75.             PATH=$PATH:/usr/ucb
  76.         fi
  77.         MANPATH=/usr/catman
  78.         defterm=vt220
  79.         SRC_COMPAT=_SYSV
  80.         export SRC_COMPAT
  81.         ;;
  82.     *)
  83.         PATH=.:/bin:/usr/bin
  84.         if [ -d /usr/ucb ]; then
  85.             PATH=$PATH:/usr/ucb
  86.         fi
  87.         MANPATH=/usr/catman
  88.         defterm=vt220
  89.         ;;
  90.     esac
  91.     if [ -d ${LOCAL}/bin ]; then
  92.         PATH=$PATH:${LOCAL}/bin
  93.     fi
  94.     if [ -d $HOME/bin -a "$HOME" != / ]; then
  95.         PATH=$PATH:$HOME/bin
  96.     fi
  97.     if [ -d ${LOCAL}/man ]; then
  98.         MANPATH=$MANPATH:${LOCAL}/man
  99.     fi
  100.     # make sure these are set at least once
  101. #    LOGNAME=${LOGNAME:-`logname`}
  102. #    USER=${USER:-$LOGNAME}
  103.  
  104.     # this is adapted from my whoami.sh
  105.     # we expect id to produce output like:
  106.     # uid=100(sjg) gid=10(staff) groups=10(staff),...
  107.     S='('
  108.     E=')'
  109. #    GROUP=`id | cut -d= -f3 | \
  110. #        sed -e "s;^[^${S}][^${S}]*${S}\([^${E}][^${E}]*\)${E}.*$;\1;"`
  111.     GROUP=other
  112.  
  113.     # set some group specific defaults
  114.     case "$GROUP" in
  115.     staff)    # staff deal with things that non-staff 
  116.         # have no business looking at
  117.         umask 027
  118.         ;;
  119.     extern)    # we put external accounts in group "extern"
  120.         # give them as much privacy as we can...
  121.         umask 077
  122.         ulimit 16384    # 8Mb file limit
  123.         TMOUT=600    # idle timeout
  124.         ;;
  125.     esac
  126.  
  127.     unset S E GROUP
  128.     export LOCAL TTY PATH LOGNAME USER
  129.  
  130.     if [ -t 1 ]; then
  131. #        TTY=`tty`
  132. #        TTY=`basename $TTY`
  133.         TTY=console
  134.         ORGANIZATION="Philippe Brand phb#telesys-innov.fr"
  135. #        COPYRIGHT="Copyright (c) `date +19%y` $ORGANIZATION"
  136.         COPYRIGHT="Copyright (c) 1993 $ORGANIZATION"
  137.         export ORGANIZATION COPYRIGHT
  138.  
  139.         # set up some env variables
  140.         MAIL=/usr/spool/mail/$USER
  141.         MAILPATH=/usr/spool/mail/$USER:/etc/motd
  142.         EMACSDIR=${LOCAL}/lib/emacs
  143.         PAGER=${PAGER:-more}
  144.         export MAIL EMACSDIR MANPATH MAILPATH PAGER
  145.  
  146.         EDITOR=emacs
  147.         FCEDIT=${EDITOR}    
  148.  
  149.         PROMPT="<$LOGNAME@$HOSTNAME>$ "
  150.         PUBDIR=/usr/spool/uucppublic
  151.         export PUBDIR 
  152.         [ -f /etc/profile.TeX ] && . /etc/profile.TeX
  153.     else
  154.         TTY=none
  155.     fi
  156.  
  157.     # test (and setup if we are Korn shell)
  158.     if [ "$RANDOM" != "$RANDOM" ]; then
  159.         # we are Korn shell
  160.         SHELL=/bin/ksh
  161.         ENV=${HOME%/}/.kshrc
  162.         PROMPT="<$LOGNAME@$HOSTNAME:!>$ "
  163.         export HISTSIZE HISTFILE ENV
  164.         CDPATH=.:$HOME
  165.         if [ "$TMOUT" ]; then
  166.             typeset -r TMOUT
  167.         fi
  168.     else
  169.         SHELL=/bin/sh
  170.     fi
  171.     PS1=$PROMPT
  172.     export SHELL PS1 EDITOR PATH PROMPT HOSTNAME CDPATH FCEDIT
  173.  
  174. ;;
  175. esac
  176.  
  177. # login time initialization
  178. case "$_INIT_" in
  179. *log*) ;;
  180. *)    _INIT_="$_INIT_"log
  181.  
  182. #    if [ $TTY != none -a "$0" != "-su" -a "$LOGNAME" = "`logname`" -a ! -f ~/.hushlogin ]
  183.     if [ $TTY != none -a "$0" != "-su" -a ! -f ~/.hushlogin ]
  184.     then
  185. #        case $TERM in
  186. #        network|unknown|dialup|"") 
  187. #            echo $N "Enter terminal type [$defterm]: $C" 1>&2
  188. #            read tmpterm
  189. #            TERM=${tmpterm:-$defterm}
  190. #            ;;
  191. #        esac
  192.         # set up desired tty modes
  193. #        stty intr '^c'
  194. #        case $TERM in
  195. #        wy50)    stty erase '^h';;
  196. #        *)    stty erase '^?';;
  197. #        esac
  198.         # welcome first time users
  199.         [ -r ${LOCAL}/etc/1stlogin.ann -a ! -f $HOME/... ] && \
  200.             . ${LOCAL}/etc/1stlogin.ann
  201.         # not all of the following are appropriate at all sites
  202.         # Sun's don't need to cat /etc/motd for instance
  203.         case "$OS" in
  204.         SunOS)    ;;
  205.         SCO-UNIX)    
  206.             [ -s /etc/motd ] && cat /etc/motd
  207.             [ -x /usr/bin/mail -a -s "$MAIL" ] && 
  208.                 echo "You have mail."
  209.             [ -x /usr/bin/news ] && /usr/bin/news -n
  210.             ;;
  211.         *)
  212.             [ -s /etc/motd ] && cat /etc/motd
  213.             if [ -x /usr/bin/mailx ]; then
  214.                if mailx -e; then
  215.                 echo "You have mail."
  216.                 # show the the headers, this might
  217.                 # be better done in .profile so they
  218.                 # can override it.
  219. #                mailx -H
  220.               fi
  221.             fi
  222.             [ -x /usr/bin/news ] && /usr/bin/news -n
  223.             ;;
  224.         esac
  225.         [ -x /usr/games/fortune ] && /usr/games/fortune -a
  226.         # remind folk who turned on reply.pl to turn it off.
  227.         if [ -f $HOME/.forward ]; then
  228.             echo "Your mail is being forwarded to:"
  229.             cat $HOME/.forward
  230.             if [ -f $HOME/.recording ]; then
  231.                 echo "Perhaps you should run \"reply.pl off\""
  232.             fi
  233.         fi
  234.     fi
  235.     unset tmpterm defterm C N
  236.     TERM=${TERM:-unknown}
  237.     export TERM TTY
  238. ;;
  239. esac
  240. # Handle X-terminals if necessary
  241. [ -f /etc/profile.X11 ] && . /etc/profile.X11
  242.